<title>query result</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<table border=2>
<tr>
{% for x in rowhead %}
    <td>{{ x[0] }}</td>
{% endfor %}
</tr>

{% for row in rs %}
<tr>
    {% for i in range(rowlength) %}
        {% if 'STRING' in rowhead[i][1] and row[i] != None %}
            <td> {{row[i].decode('utf8')}} </td>
        {% elif row[i] == None %}
            <td> </td>
        {% else %}
            <td> {{row[i]}} </td>
        {% endif %}
    {% endfor %}
</tr>
{% endfor %}


